package com.tony.business.config;

import org.springframework.boot.web.server.ErrorPage;
import org.springframework.boot.web.server.ErrorPageRegistrar;
import org.springframework.boot.web.server.ErrorPageRegistry;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;

/**
 * @author tony
 */
/*@Component
public class ErrorConfig implements ErrorPageRegistrar {
    @Override
    public void registerErrorPages(ErrorPageRegistry registry) {
        ErrorPage[] errorPages=new ErrorPage[6];
        errorPages[0]=new ErrorPage(HttpStatus.BAD_REQUEST,"/400");
        errorPages[1]=new ErrorPage(HttpStatus.UNAUTHORIZED,"/401");
        errorPages[2]=new ErrorPage(HttpStatus.FORBIDDEN,"/403");
        errorPages[3]=new ErrorPage(HttpStatus.NOT_FOUND,"/404");
        errorPages[4]=new ErrorPage(HttpStatus.METHOD_NOT_ALLOWED,"/405");
        errorPages[5]=new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR,"/500");

        registry.addErrorPages(errorPages);
    }
}*/
